package com.example.exercise.task;

import com.example.exercise.step.service.StepService;
import jakarta.annotation.Resource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.stream.IntStream;

@Component
public class StepTask {

    @Resource
    private StepService stepService;

    @Scheduled(cron = "0/10 * * * * ?")
    public void uploadStep() {
        IntStream.range(0, 20).parallel().forEach(i -> stepService.uploadStep());
    }

}
